Skip to content

Conversation

@kimtth
Copy link

@kimtth kimtth commented Jul 31, 2024

Establish a connection using Browser Interactive mode

@kimtth
Copy link
Author

kimtth commented Jul 31, 2024

@microsoft-github-policy-service agree

@kimtth
Copy link
Author

kimtth commented Aug 1, 2024

Sorry for typos.

  1. tenant_id=tenant_id -> tenant_id=_tenant_id
  2. "access_token": access_token -> "access_token": access_token.token
# Fill in with your tenant id and org URL
organization_url = 'https://dev.azure.com/YOURORG'
_tenant_id= 'YOURORG_TENANT_ID'

# Create a connection to the org
credentials = InteractiveBrowserCredential(tenant_id=_tenant_id)
# The scope for the token should be 499b84ac-1321-427f-aa17-267ca6975798/.default which provides access to Azure DevOps Services REST API.
access_token = credentials.get_token("499b84ac-1321-427f-aa17-267ca6975798/.default")
token_auth = BasicTokenAuthentication({"access_token": access_token.token})
connection = Connection(base_url=organization_url, creds=token_auth)

@JF6
Copy link

JF6 commented Aug 1, 2024

Nice addition (can be considered part of SFI imo)

@vs4vijay
Copy link
Member

It doesn't support refreshing the access token and other related use cases. We need proper support of Azure Identity in Azure DevOps SDK.

@kimtth kimtth closed this Jul 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants